package com.sitech.portal.system.dao.ibatis;

import java.util.HashMap;
import java.util.List;

import com.sitech.ibnms.core.BaseIbnmsDao;
import com.sitech.ibnms.core.IPage;
import com.sitech.ibnms.core.PageForm;
import com.sitech.portal.system.dao.ISysRolePortalDao;

public class SysRolePortalDaoImpl extends BaseIbnmsDao implements ISysRolePortalDao {

	public List findRolePortalList() {
			return this.query("findRolePortalList", null);
	}

	public void add(HashMap map) {
			this.insert("insertForTB_SYS_ROLE_PORTAL", map);
	}

	public void update(HashMap map) {
			this.update("updateForTB_SYS_ROLE_PORTAL", map);
	}

	public List findAllPanel() {
			return this.query("findAllPanel", null);
	}

	public void deleteForTB_SYS_ROLE_PORTALByPK(String portal_order) {

			this.delete("deleteForTB_SYS_ROLE_PORTALByPK", portal_order);
	}

	public IPage findListRolePortal(PageForm pageForm) {
			return this.findPage("findListRolePortal", pageForm);

	}

	public HashMap findObjForTB_SYS_ROLE_PORTALByPK(String portal_order) {
			return (HashMap) this.querySingle(
					"findObjForTB_SYS_ROLE_PORTALByPK", portal_order);
	}

	public List findCanRoles(String ROLE_IDS) {
			String sql = " select * from tb_sys_role where role_id not in ("
					+ ROLE_IDS + ")";
			return this.query("findCanRoles", sql);
	}

	public List findSelectRoles(String ROLE_IDS) {
			String sql = "select * from tb_sys_role where role_id in ("
					+ ROLE_IDS + ")";
			return this.query("findSelectRoles", sql);
	}

	public List findCanPanel(String panels) {
			String sql = "select PANEL_ID,PANEL_NAME from TB_SYS_PANEL_CONFIG "
					+ "where panel_id not in (" + panels + ")";
			return this.query("findCanPanel", sql);
	}

	public List findSelectPanel(String panels) {
			String sql = "select PANEL_ID,PANEL_NAME from TB_SYS_PANEL_CONFIG "
					+ "where panel_id in (" + panels + ")";
			return this.query("findSelectPanel", sql);
	}
}
